<!DOCTYPE html>
<html lang="en" xmlns:th="https://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>人员信息查询</title>
    <script src="/js/jquery.min.js"></script>
    <script>
        $(function () {
            $.ajax({
                url:"/getDepartment",
                type:"post",
                contentType: 'text/html,charset=utf-8',
                success:function (result) {
                    console.info(result);
                    var proList = JSON.parse(result);
                    $("#department").append("<option value=\"0\">查询所有</option>");
                    for(var i=0;i<proList.length;i++){
                        var item = proList[i];

                        $("#department").append("<option value="+item.mid+">"+item.dtype+"</option>");

                    }
                }
            })
            $.ajax({
                url:"/test3",
                type:"get",
                contentType: 'text/html,charset=utf-8',
                success:function (result) {
                    console.info(result);
                    var proList = JSON.parse(result);
                    $("#mname").append("<option value=\"all\">查询所有</option>");
                    for(var i=0;i<proList.length;i++){
                        var item = proList[i];

                        $("#mname").append("<option value="+item.mname+">"+item.mname+"</option>");

                    }
                }
            })
        })
    </script>
</head>
<body>
<table>
    <tr>ID</tr>
    <tr>姓名</tr>
    <tr>年龄</tr>
    <tr>编号</tr>
    <tr>用户名</tr>
    <tr>密码</tr>
    <tr>科室名称</tr>
    <tr>性别</tr>
    <tr>状态</tr>
    <tr>地址</tr>
    <tr>DID</tr>
    <tr th:each="item:${worker}">
        <td th:text="${item.dname}"></td>
        <td th:text="${item.dage}"></td>
        <td th:text="${item.dnumber}"></td>
        <td th:text="${item.dusername}"></td>
        <td th:text="${item.dpassword}"></td>
        <td th:text="${item.mname}"></td>
        <td th:text="${item.dsex}"></td>
        <td th:text="${item.drole}"></td>
        <td th:text="${item.adress}"></td>
        <td th:text="${item.deptnoid}"></td>
        <td th:text="${item.proName}"></td>
    </tr>
</table>
<div><a href="/worker/addworker">增加医护人员信息</a></div>
</body>
</html>
